/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package physical_spaces.beans;

import java.io.Serializable;
import java.sql.SQLException;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import physical_spaces.DAO.PhysicalSpaceDAO;
import physical_spaces.business.GlobalVariable;
import physical_spaces.business.GlobalVariablesBusiness;

/**
 *
 * @author chucho
 */
@ManagedBean
@RequestScoped
public class GlobalVariablesBean implements Serializable {

    private List<GlobalVariable> globalVariables;

    public List<GlobalVariable> getGlobalVariables() {
        return globalVariables;
    }

    public void setGlobalVariables(List<GlobalVariable> globalVariables) {
        this.globalVariables = globalVariables;
    }

    public GlobalVariablesBean() {
        GlobalVariablesBusiness ob;
        try {
            ob = new GlobalVariablesBusiness(new PhysicalSpaceDAO().getGlobalVariables());
            globalVariables = ob.getGlobalVariables();
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
    }
}
